<template>
<view>
<view class="info">
    <view class="info_sec flex">
        <view class="txt">真实姓名</view>
        <view class="detail">{{realname}}</view>
    </view>
    <view class="info_sec flex">
        <view class="txt">证件类型</view>
        <view class="detail">{{idcardType}}</view>
    </view>
    <view class="info_sec flex">
        <view class="txt">证件号码</view>
        <view class="detail">{{idcard}}</view>
    </view>
    <view class="info_sec flex">
        <view class="txt">手机号码</view>
        <view class="detail">{{mobile}}</view>
    </view>
</view>
<view class="tips">
    <view class="tip">温馨提示</view>
    <view>如需修改个人基本资料或完善其他资料，请登录人人志愿App进行修改。</view>
</view>
<view @tap="tapToLogout" class="logout">退出登录</view>
</view>
</template>

<script>
var e = require("../../../utils/request.js"),
    n = (require("../../../utils/util.js"), function (e) {
  return e && e.__esModule ? e : {
    default: e
  };
}(require("../../../utils/api.js"))),
    app = getApp(),
    userUnbind = n.default.userUnbind;

export default {
  data() {
    return {
      realname: "",
      idcardType: "",
      idcard: "",
      mobile: ""
    };
  },

  components: {},
  props: {},
  onLoad: function (e) {
    if (console.log(e), e.name) {
      var n = e.name,
          o = e.idcard,
          a = e.cardType,
          t = e.mobile;
      console.log(a), this.setData({
        realname: n,
        idcardType: 1 == a ? "居民身份证" : 2 == a ? "护照" : 3 == a ? "香港居民身份证" : 4 == a ? "澳门居民身份证" : 5 == a ? "台湾身份证" : "居民身份证",
        idcard: 1 == a ? o.substr(0, 8) + "******" + o.substr(14, 17) : o,
        mobile: t
      });
    }
  },
  onReady: function () {},
  onShow: function () {},
  onHide: function () {},
  onUnload: function () {},
  onPullDownRefresh: function () {},
  onReachBottom: function () {},
  onShareAppMessage: function () {
    return {
      title: "让公益更生活 让生活更公益",
      path: "/pages/index/index",
      imageUrl: "/static/images/zyh_logo.jpg"
    };
  },
  methods: {
    tapToLogout: function () {
      var e = this;
      uni.showModal({
        title: "温馨提示",
        content: "确定退出当前账号并解绑小程序吗？",
        showCancle: !0,
        cancelText: "再看看",
        cancelColor: "#333333",
        confirmText: "立即退出",
        confirmColor: "#24CBA9",
        success: function (n) {
          n.confirm && e.userUnBindRequest().then(function (e) {
			  uni.clearStorageSync()
            app.globalData.loginFlag = !1, app.globalData.token = "", app.globalData.zyzId = "", uni.switchTab({
              url: "/pages/index/index"
            });
          });
        }
      });
    },
    userUnBindRequest: function () {
      var n = {
        data: {
          api: userUnbind,
        },
        token: app.globalData.token
      };
      return (0, e.request)(n, "normal", !0);
    }
  }
};
</script>
<style>
page {
    width: 100%;
    height: 100%;
    background: #f4f4f4;
}

.info {
    width: 100%;
    height: auto;
    padding-left: 30rpx;
    background: #fff;
}

.info_sec {
    width: 100%;
    height: 100rpx;
    line-height: 100rpx;
    font-size: 28rpx;
}

.info_sec+.info_sec {
    border-top: 1rpx solid #e1e2e3;
}

.info_sec {
    justify-content: flex-start;
}

.info_sec .txt {
    flex: 0 0 150rpx;
    width: 150rpx;
    color: #999;
}

.info_sec .detail {
    flex: auto;
    color: #333;
}

.tips {
    padding: 20rpx 30rpx;
    line-height: 30rpx;
    font-size: 24rpx;
}

.logout {
    width: 100%;
    height: 100rpx;
    line-height: 100rpx;
    text-align: center;
    background: #fff;
    font-size: 28rpx;
    color: #333;
}
</style>